home *** CD-ROM | disk | FTP | other *** search
Text File | 1998-12-10 | 4.1 KB | 108 lines | [TEXT/MPS ] |
- Instructions - The SIOW Example
-
- Copyright Apple Computer, Inc. 1990, 1994, 1996
- All rights reserved.
-
- About the Example
-
- SIOW (Simple Input/Output Window) is a package that enables a program
- (C or Pascal), which does I/O in "glass teletype" fashion, to became a
- stand-alone application running in its own window. The MPW 3.3 "Building
- and Managing Programs in MPW" manual describes the behavior of such
- applications in detail. (See the release notes for up-to-date info.)
-
- In brief, an input operation following a prompt will read only the
- characters that were actually typed or selected. That is, the prompt
- is not read unless it is explicitly selected. Most of the
- items in the File, Edit, Font, and Size menus are available (not dimmed),
- and operate as one would expect.
-
- The only example provided presently is a version of Count, derived from the
- version to be found in CExamples. SIOW applications support drop-launching
- similar to AppleScript "droplets" -- they can be launched by dragging
- files, folders, or disk icons onto the application icon in the
- finder, and the pathnames show up in the argc/argv parameter list
- of the application's main() function.
-
- In this example, if Count is not drop-launched, then it interactively
- gets a list of filenames from the user. In all cases it interactively
- asks if a count of lines, characters, or both is desired, because
- that kind of "command-line" option is not yet available in the argc/argv
- parameter list. In the version of Count in CExamples, all of this
- information is taken from the command line in MPW Shell.
-
- This example does not prompt the user to save the output. This was
- specified in the Make files by the rez option "-d DEFAULT_SAVE_PREF=1".
- See SIOW.h for more information about controlling SIOW behavior via
- preference resources. Note also that if you choose Save near the
- beginning of the program's execution, all the current output will
- be saved, and all of the succeeding output will also be appended to
- that file. Thus, even if the total output results in more text than can be
- shown in the window (approx 32 KB), all of the output will be saved.
-
- Building the Example
-
- If this example is not on your hard disk, copy its folder to
- your hard disk.
-
- Set the default directory to "SIOWExamples". Depending on where the
- folder is located, this can be done by the command:
-
- Directory "{MPW}Examples:SIOWExamples:"
-
- Make sure your directory structure contains the following header files:
-
- ...:Interfaces:RIncludes:SIOW.h # "{RIncludes}"
- ...:Interfaces:RIncludes:SIOW.r # "{RIncludes}"
-
- Make sure your directory structure contains the following library files:
-
- ...:Libraries:PPCLibraries:PPCSIOW.o # "{PPCLibraries}"
- ...:Libraries:Libraries:SIOW # "{Libraries}"
- ...:Libraries:Libraries:SIOW.far.o # "{Libraries}"
- ...:Libraries:Libraries:NuSIOW.o # "{CFM68KLibraries}"
-
- You can build the example as a 'fat' application by executing one of the
- following commands (this utilizes the supplied Makefile):
-
- # this command line builds a "fat" app, consisting of both
- # PowerPC and classic 68K executable.
-
- BuildProgram -e Count ∑∑ "{worksheet}"
-
- or
-
- # this command line builds a "fat" app, consisting of both
- # PowerPC and CFM-68K executable.
-
- make -f Makefile.cfm68k Count.cfm68k -e > make.out
- make.out ∑∑ "{Worksheet}"
-
- Launching the program
-
- Count can be launched from MPW as if it were a tool (with filename
- arguments), or, alternatively, it can be launched from the Finder
- in the same way as any other application.
-
- Currently, pathnames can be provided to count by dragging files or
- in the finder to drop-llaunch the Count application. Up to 179 files have
- been successfully dropped onto Count at one time -- this may be limited by heap
- size, the current implementation of the Finder, or AppleEvent data-structures.
-
- Example output:
-
- Command-line
- Count Count.c
- in MPW Shell, or by dropping Count.c onto the Count application in the Finder.
-
- Count
- 'HD:MPW:Examples:SIOWExamples:Count.c'
-
- Report desired (C[haracters], L[ines], B[oth]:b
-
- lines chars filename
- 232 4668 HD:MPW:Examples:SIOWExamples:Count.c
-
- done
-
-